/**
@file     	DESIGNPATTERN_Facade.cpp
@brief    	To ensure that a class has only one instance
@author  	arvin
@version 	1.0   2012/12/12
*/
#include "stdafx.h"

#ifndef CXX_DESIGNPATTERN_FACADE_H
#include "DESIGNPATTERN_Facade.h"
#endif

Facade* Facade::m_pInstance = NULL;


/**
* Construction
*
* @param VOID
* @return
*/
Facade::Facade()
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return
*/
Facade::~Facade()
{
	DEBUG_PRINTF("");
}

/**
* Instance
*
* @param VOID
* @return Facade*
* @note Facade
*/
Facade*
Facade::Instance()
{
	DEBUG_PRINTF("");
	if (NULL == m_pInstance) {
		m_pInstance = new Facade;
	}
	return m_pInstance;
}


/**
* Destroy
*
* @param VOID
* @return VOID
* @note singleton
*/
VOID
Facade::Destroy()
{
	DEBUG_PRINTF("");
	if (NULL != m_pInstance) {
		delete m_pInstance;
		m_pInstance = NULL;
	}
}

/**
* OperationWrapper
*
* @param VOID
* @return VOID
* @note
*/
VOID 
Facade::OperationWrapper()
{
	DEBUG_PRINTF("");
	m_cSubSystem1.Operation();
	m_cSubSystem2.Operation();
}
/* EOF */